/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.system.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.sql.Timestamp;
import java.math.BigDecimal;
import java.io.Serializable;

/**
* @website https://el-admin.vip
* @description /
* @author wangyu
* @date 2024-03-20
**/
@Entity
@Data
@Table(name="user_account_bill")
public class UserAccountBill implements Serializable {

    @Id
    @Column(name = "bill_id")
    @ApiModelProperty(value = "主键ID")
    private Long billId;

    @Column(name = "sys_user_id")
    @ApiModelProperty(value = "系统用户ID")
    private Long sysUserId;

    @Column(name = "acct_no")
    @ApiModelProperty(value = "账户编号")
    private String acctNo;

    @Column(name = "open_id")
    @ApiModelProperty(value = "用户openid")
    private String openId;

    @Column(name = "bill_type")
    @ApiModelProperty(value = "类型，0：收入，1：提现，2：消费支出")
    private Integer billType;

    @Column(name = "amount")
    @ApiModelProperty(value = "变更金额")
    private BigDecimal amount;

    @Column(name = "thd_flowid")
    @ApiModelProperty(value = "三方流水号")
    private String thdFlowid;

    @Column(name = "approval_state")
    @ApiModelProperty(value = "审批状态(0：提交申请 1： 处理中 2：成功 3：驳回)")
    private Integer approvalState;

    @Column(name = "cashout_state")
    @ApiModelProperty(value = "提现状态 (0: 待处理,1:处理中，2成功，3：失败,4驳回")
    private Integer cashoutState;

    @Column(name = "fail_msg")
    @ApiModelProperty(value = "原因")
    private String failMsg;

    @Column(name = "biz_no")
    @ApiModelProperty(value = "业务编号")
    private String bizNo;

    @Column(name = "biz_source")
    @ApiModelProperty(value = "业务来源")
    private Integer bizSource;

    @Column(name = "create_time")
    @ApiModelProperty(value = "创建时间")
    private Timestamp createTime;

    @Column(name = "bill_status")
    @ApiModelProperty(value = "账单状态0：无效，1：有效，2：过期，3：作废")
    private Integer billStatus;

    @Column(name = "expire_time")
    @ApiModelProperty(value = "账单过期时间")
    private Timestamp expireTime;

    @Column(name = "bill_remark")
    @ApiModelProperty(value = "账单备注")
    private String billRemark;

    @Column(name = "mobile")
    @ApiModelProperty(value = "手机号")
    private String mobile;

    public void copy(UserAccountBill source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}